<div class="px-6 py-4 flex justify-between items-center border-t border-gray-200">
    <div class="text-sm text-gray-500">
        显示 {{ pagination.items|length }} 条记录，共 {{ pagination.total }} 条
    </div>
    <div class="flex space-x-2">
        {% if pagination.has_prev %}
            <a href="{{ url_for(endpoint, page=pagination.prev_num, **url_params) }}"
               class="px-4 py-2 text-sm border rounded hover:bg-gray-50">上一页</a>
        {% endif %}

        {% for page_num in pagination.iter_pages(left_edge=2, left_current=2, right_current=2, right_edge=2) %}
            {% if page_num %}
                {% if page_num == pagination.page %}
                    <span class="px-4 py-2 text-sm border rounded bg-blue-500 text-white">{{ page_num }}</span>
                {% else %}
                    <a href="{{ url_for(endpoint, page=page_num, **url_params) }}"
                       class="px-4 py-2 text-sm border rounded hover:bg-gray-50">{{ page_num }}</a>
                {% endif %}
            {% else %}
                <span class="px-4 py-2 text-sm">...</span>
            {% endif %}
        {% endfor %}

        {% if pagination.has_next %}
            <a href="{{ url_for(endpoint, page=pagination.next_num, **url_params) }}"
               class="px-4 py-2 text-sm border rounded hover:bg-gray-50">下一页</a>
        {% endif %}
    </div>
</div>